package com.cqhfan.chatroom.domain.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.cqhfan.chatroom.enums.ChatType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户聊天列表项
 * </p>
 *
 * @author 眭传洪
 * @since 2024-11-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("chat_list")
public class ChatList implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 列表所属用户
     */
    private Long userId;

    /**
     * 1单人 2群聊
     */
    private ChatType type;

    /**
     * 群id
     */
    private Long groupId;

    /**
     * 接收用户id
     */
    private Long receiverId;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;


}
